package com.atguigu.guli.service.edu.mapper;

import com.atguigu.guli.service.edu.entity.Course;
import com.atguigu.guli.service.edu.entity.vo.CoursePublishVo;
import com.atguigu.guli.service.edu.entity.vo.CourseVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @className: CourseMapper
 * @description: 课程 Mapper 接口
 * @date: 2020/12/6
 * @author: cakin
 */
@Repository
public interface CourseMapper extends BaseMapper<Course> {
    /**
     * 功能描述：根据分页和查询条件查询课程列表
     *
     * @author cakin
     * @date 2020/12/6
     * @param pageParam 分页参数
     * @param queryWrapper 查询条件
     * @return List<CourseVo> 课程列表
     */
    List<CourseVo> selectPageByCourseQueryVo(
            Page<CourseVo> pageParam,
            @Param(Constants.WRAPPER) QueryWrapper<CourseVo> queryWrapper);

    /**
     * 功能描述：根据课程信息获得发布课程
     *
     * @author cakin
     * @date 2020/12/6
     * @param id 课程id
     * @return CoursePublishVo 课程发布信息
     */
    CoursePublishVo selectCoursePublishVoById(String id);
}
